package misc;

import engine.GameEngine;
import engine.data.Player;
import engine.data.Tile;
import engine.graphics.MapCanvasEngine;

public final class Debug {

	private Debug() {
		// no constructor
	}

	private static boolean debug = true;

	public static void logConsole(final String str) {
		if (debug)
			System.out.println(str);
	}

	public static void printTiles(final Tile[][] tiles) {
		for (short i = 0; i < tiles.length; i++) {
			for (short j = 0; j < tiles[0].length; j++)
				if (tiles[i][j] != null)
					Debug.logConsole("(" + i + "," + j + ")[" + tiles[i][j].toString() + "]");
		}
	}

	public static void showMap(final Player player) {
		player.type = Player.HUMAN;
		GameEngine.map.revealMap(player);
		player.type = Player.COMPUTER;
		MapCanvasEngine.canvas.displayMap();
	}
}
